using System;
using System.Collections.Generic;
using System.Text;

namespace XnaDevRu.Bullet.LinearMath
{
    public abstract class QuadWord
    {
        private float x;
        private float y;
        private float z;
        private float w;

        public float X { get { return x; } set { x = value; } }
        public float Y { get { return y; } set { y = value; } }
        public float Z { get { return z; } set { z = value; } }
        public float W { get { return w; } set { w = value; } }

        public QuadWord() { }

        public QuadWord(float x, float y, float z, float w)
        {
            X = x;
            Y = y;
            Z = z;
            W = w;
        }

        public QuadWord(float x, float y, float z)
        {
            X = x;
            Y = y;
            Z = z;
            W = 0;
        }

        public void SetMax(QuadWord other)
        {
            if (other.X > X)
                X = other.X;

            if (other.Y > Y)
                Y = other.Y;

            if (other.Z > Z)
                Z = other.Z;

            if (other.W > W)
                W = other.W;
        }

        public void SetMin(QuadWord other)
        {
            if (other.X < X)
                X = other.X;

            if (other.Y < Y)
                Y = other.Y;

            if (other.Z < Z)
                Z = other.Z;

            if (other.W < W)
                W = other.W;
        }
    }
}
